package org.community.loginsvc.service.detailservice.converter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import sun.misc.BASE64Encoder;


@Component
@Slf4j
public class ImgConverter {

    //图片流转化器
    public String bytesToImageBufferedString(byte[] bytes){
        log.info("bytesToImageBufferedString开始运行");
        //图片加密
        BASE64Encoder encoder = new BASE64Encoder();
        String bufferedImgString = encoder.encodeBuffer(bytes).trim();
        log.info("BASE64Encoder开始运行");
//        log.info("图片加密后的流:{}",bufferedImgString);
        return bufferedImgString;
    }



}
